package com.projectmanagement.model.data;

import java.io.Serializable;
import java.sql.Timestamp;

import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

@Entity
@Table(name = "Project_files")
public class ProjectFile implements Serializable {

	private static final long serialVersionUID = -42203455605696647L;

	@Id
	@Column(name = "id")
	@GeneratedValue
	private long id;

	@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.LAZY)
	private File message;

	@Column(name = "is_private", nullable = false)
	private boolean isPrivate = false;

	@Column(name = "added_on", nullable = false)
	private Timestamp addedOn = new Timestamp(0);

	public long getId() {
		return id;
	}

	public void setId(long id) {
		this.id = id;
	}

	public File getMessage() {
		return message;
	}

	public void setMessage(File message) {
		this.message = message;
	}

	public boolean isPrivate() {
		return isPrivate;
	}

	public void setPrivate(boolean isPrivate) {
		this.isPrivate = isPrivate;
	}

	public Timestamp getAddedOn() {
		return addedOn;
	}

	public void setAddedOn(Timestamp addedOn) {
		this.addedOn = addedOn;
	}

}
